package net.xdclass.rbac_shiro.config;

import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.eis.SessionIdGenerator;

import java.io.Serializable;
import java.util.UUID;

/**
 * Created whit IntelliJ IDEA
 * User:杨骏杰
 * Date:2021/2/17
 * Time:10:38
 * 自定义sessionID
 */
public class CustomSessionIdGenerator implements SessionIdGenerator {

    /**
     * 重写SessionId的生成方法
     * @param session
     * @return
     */
    @Override
    public Serializable generateId(Session session) {
        return "xdclass"+UUID.randomUUID().toString();
    }
}
